home *** CD-ROM | disk | FTP | other *** search
-
- {
- if(true)
- {
- CSpriteFrame = §§newclass(CSpriteFrame,Object);
- }
- }
-
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import flash.display.*;
- import flash.events.*;
- import flash.filters.*;
- import flash.geom.*;
-
- public class CSpriteFrame
- {
-
- public static const zPoint:Point;
-
- public static const mMatrixScalar:Matrix;
-
- public static var mFlipX:Boolean = false;
-
- {
- if(true)
- {
- zPoint = new Point(0,0);
- if(true)
- {
- mMatrixScalar = CThingSprite.mMatrixScalar;
- }
- mFlipX = false;
- }
- }
-
- public var mCanDispose:Boolean = false;
-
- private var mcContainer:MovieClip;
-
- public var mBMD:BitmapData;
-
- public var mDispMatrix:Matrix;
-
- public var mArea:Rectangle;
-
- public var mDisplacement:Point;
-
- public var mObjects:Object;
-
- public var mFrameIndex:int;
-
- private var mcGraphic:MovieClip;
-
- public function CSpriteFrame()
- {
- if(true)
- {
- mCanDispose = false;
- if(true)
- {
- super();
- }
- mObjects = new Object();
- }
- }
-
- public static function asMovieClip(param1:MovieClip) : CSpriteFrame
- {
- var _loc2_:CSpriteFrame = null;
- _loc2_ = new CSpriteFrame();
- if(true)
- {
- _loc2_.mcContainer = new MovieClip();
- var _loc3_:*;
- _loc2_.mcGraphic = _loc3_ = param1;
- _loc2_.mcContainer.addChild(_loc3_);
- }
- return _loc2_;
- }
-
- public static function asFrame(param1:Object) : CSpriteFrame
- {
- var _loc2_:CSpriteFrame = null;
- _loc2_ = new CSpriteFrame();
- _loc2_.mBMD = param1.bmd;
- _loc2_.mDisplacement = param1.disp;
- _loc2_.Finalize();
- return _loc2_;
- }
-
- private function _compileObjects(param1:MovieClip, param2:Matrix, param3:String = "") : void
- {
- var _loc4_:int = 0;
- var _loc5_:* = undefined;
- var _loc6_:* = null;
- var _loc7_:Point = null;
- var _loc8_:Matrix = null;
- if(true)
- {
- _loc4_ = param1.numChildren - 1;
- }
- for(; _loc4_ >= 0; _loc4_--)
- {
- if((_loc5_ = param1.getChildAt(_loc4_)) == null)
- {
- continue;
- }
- §§push(_loc5_.name.indexOf("instance") == 0);
- if(true)
- {
- §§push(§§pop() || _loc5_.name == "");
- }
- if(§§pop())
- {
- continue;
- }
- §§push(String(_loc5_.name));
- if(true)
- {
- §§push(_loc6_ = §§pop());
- if(true)
- {
- if(§§pop().indexOf("vis_") == 0)
- {
- addr82:
- _loc6_ = String(_loc6_.substring(4));
- _loc5_.visible = true;
- addr79:
- }
- else
- {
- _loc5_.visible = false;
- }
- (_loc7_ = param2.deltaTransformPoint(new Point(1,0))).normalize(1);
- if(true)
- {
- mObjects[param3 + _loc6_] = {
- "mPosition":param2.transformPoint(new Point(_loc5_.x,_loc5_.y)),
- "mDelta":_loc7_
- };
- }
- (_loc8_ = _loc5_.transform.matrix).concat(param2);
- if(true)
- {
- _compileObjects(_loc5_,_loc8_,_loc6_ + "_");
- }
- continue;
- }
- §§goto(addr79);
- }
- §§goto(addr82);
- }
- }
-
- public function get mMemSize() : uint
- {
- return mBMD.width * mBMD.height * 4;
- }
-
- public function ApplyWhiten() : void
- {
- if(true)
- {
- mcGraphic.transform.colorTransform = new ColorTransform(1,1,1,1,255,255,255,255);
- }
- }
-
- public function ApplyGreen() : void
- {
- mcGraphic.transform.colorTransform = new ColorTransform(0,1,0,1,0,255,0,255);
- }
-
- public function ApplyBlue() : void
- {
- if(true)
- {
- mcGraphic.transform.colorTransform = new ColorTransform(0,0,1,1,0,0,255,255);
- }
- }
-
- public function ApplyReden() : void
- {
- mcGraphic.transform.colorTransform = new ColorTransform(1,0,0,1,255,0,0,255);
- }
-
- public function PostFilter(param1:*) : void
- {
- mBMD.applyFilter(mBMD,mBMD.rect,zPoint,param1);
- }
-
- public function CaptureMovieClip() : void
- {
- var _loc1_:Rectangle = null;
- var _loc2_:Point = null;
- var _loc3_:Object = null;
- _loc1_ = mcContainer.getBounds(mcContainer);
- _loc1_.inflate(2,2);
- mBMD = new BitmapData(_loc1_.width,_loc1_.height,true,16711680);
- mDisplacement = new Point(Math.floor(_loc1_.left),Math.floor(_loc1_.top));
- _compileObjects(mcGraphic,mcGraphic.transform.matrix);
- mBMD.draw(mcContainer,new Matrix(1,0,0,1,-mDisplacement.x,-mDisplacement.y));
- if(mcGraphic["_origin"])
- {
- _loc2_ = mcGraphic.transform.matrix.transformPoint(new Point(mcGraphic["_origin"].x,mcGraphic["_origin"].y));
- if(true)
- {
- mDisplacement.x -= _loc2_.x;
- mDisplacement.y -= _loc2_.y;
- }
- for each(_loc3_ in mObjects)
- {
- _loc3_.mPosition = _loc3_.mPosition.subtract(_loc2_);
- }
- }
- Finalize(mcGraphic.transform.matrix);
- }
-
- public function ApplyFilter(param1:*) : void
- {
- if(true)
- {
- mcContainer.filters.push(param1);
- }
- }
-
- public function ApplyBlacken() : void
- {
- if(true)
- {
- mcGraphic.transform.colorTransform = new ColorTransform(0,0,0,1,0,0,0,255);
- }
- }
-
- public function ApplyScaleMatrix(param1:Matrix) : void
- {
- if(true)
- {
- mcGraphic.transform.matrix = param1;
- }
- }
-
- public function Finalize(param1:Matrix = null) : void
- {
- mDispMatrix = new Matrix(1,0,0,1,mDisplacement.x,mDisplacement.y);
- mArea = new Rectangle(-mDisplacement.x,-mDisplacement.y,mBMD.width,mBMD.height);
- }
-
- public function Dispose() : Boolean
- {
- §§push(mCanDispose);
- if(true)
- {
- if(§§pop())
- {
- mBMD.dispose();
- return true;
- }
- §§push(false);
- }
- return §§pop();
- }
- }
- }
-